using Mirror;
using MrPP.SampleLib;
using UnityEngine;
using GDGeek;

namespace Shows_3D
{
    public static class PointDataReaderWriter
    {
        public static void WritePointData(this NetworkWriter writer, MrPP.SampleLib.Point.Data data)
        {
            writer.WriteInt32(data.id);
            writer.WriteString(data.title);
            writer.WriteString(data.type);
            writer.WriteString(data.data);
            writer.WriteInt32(data.parent);
            writer.Write(data.transform);
            writer.WriteList(data.effects);
        }

        public static MrPP.SampleLib.Point.Data ReadPointData(this NetworkReader reader)
        {
            return new MrPP.SampleLib.Point.Data(reader.ReadInt32(), reader.ReadString(), reader.ReadString(), reader.ReadString(), reader.ReadInt32(),reader.Read<TransformRounding>(),reader.ReadList<EffectFactory.Data>());
            //data.id = reader.ReadInt32();
            //data.title = reader.ReadString();
            //data.type = reader.ReadString();
            //data.transform = reader.Read<TransformRounding>();
            //data.data = reader.ReadString();
            //data.parent = reader.ReadInt32();
            //return data;
        }
    }
}